package advance.x000;

import java.util.Scanner;

public class Lowbit {
    public static final int MAX_N = 1 << 20;

    public static void main(String[] args) {
        // （2^k mod 37 ）互相独立且恰好落在1-36之间
        int[] H = new int[37];
        // 提前求出lowbit值：K
        for (int i = 0; i <= 36; i++) {
            // 1 需要强转L，32位int 型，36位溢出
            H[(int) ((1l << i) % 37)] = i;
        }
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            while (n > 0) {
                System.out.print(H[(n & -n) % 37] + "  ");
            }
            System.out.println();
        }

    }

    // 搭配hash找出二进制表下所有是1的位
    public static void main2(String[] args) {

        int[] H = new int[MAX_N + 1];
        for (int i = 0; i <= 20; i++) {
            // 提前存储log2 对数的值
            // 1:0 2:1 4:2 8:3
            H[1 << i] = i;
        }
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            while (n > 0) {
                System.out.print(H[n & -n] + "   ");
                n -= n & -n;
            }
            System.out.println();
        }
    }
}
